package com.pks.datacenter.entity.api;

import lombok.Data;
import lombok.EqualsAndHashCode;

import com.pks.util.coder.database.DBField;
import com.pks.util.coder.database.DBQuery;
import com.pks.util.coder.database.DBTable;
import com.pks.web.mybatis.entity.BasicEntity;

@Data
@EqualsAndHashCode(callSuper = true)
@DBTable(tags = "接口apiToken")
public class ApiToken extends BasicEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3933080486873810891L;

	public static final long effective_default = 4 * 60 * 60 * 1000l;

	@DBField(comment = "apiToken", nullable = false, length = 255)
	@DBQuery
	private String apiToken;
	
	@DBField(comment = "接口帐号（apiuser）id", nullable = false)
	@DBQuery
	private Long apiUserId;
	
	@DBField(comment = "接口帐号名称", nullable = false, length = 255)
	private String apiUserAccount;
	
	@DBField(comment = "接口调用白名单",length = 2000)
	private String allowIps;
	
	@DBField(comment = "token计时开始时间")
	private Long start_time_long;
	
	@DBField(comment = "token有效时间", nullable = false)
	private Long effective;

	/**接口账号信息，存redis的时候一起存，便捷使用*/
	private ApiUser show_apiUser;
	
	

}
